package com.zhangsun.db2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhangsun.db2.entity.DB2UserEntity;
import com.zhangsun.db2.mapper.DB2UserMapper;
import com.zhangsun.db2.service.DB2UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DB2UserServiceImpl extends ServiceImpl<DB2UserMapper, DB2UserEntity> implements DB2UserService {

    @Override
    public List<DB2UserEntity> findAll() {
        LambdaQueryWrapper<DB2UserEntity> queryWrapper = new QueryWrapper<DB2UserEntity>().lambda();
        Page<DB2UserEntity> page = new Page<>(1, 10);
        return baseMapper.selectPage(page, queryWrapper).getRecords();
    }
}
